package net.ssta.util.bill;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import net.ssta.core.db.DBConnectionProvider;
import net.ssta.core.db.Record;
import net.ssta.core.db.RecordSet;

import com.yztc.rc.api.framework.Context;
import com.yztc.rc.api.framework.ContextFactory;

/**
 * 用户账单
 * @author Administrator
 *
 */
public class UserBill {
	private static Logger log = Logger.getLogger(UserBill.class.getClass()); 
	private String costIp;
	private String costUserName;
	private int costNumber;
	private String cType;
	private Date costTime;
 	private String channelId;
	private String infoId;
	private String operatorId;
	private int remain;//剩余积分
	private String title;
	private String mark;
	
	private Date startDate;
	private Date endDate;
	
	/**
	 * @return the remain
	 */
	public int getRemain() {
		return remain;
	}


	/**
	 * @param remain the remain to set
	 */
	public void setRemain(int remain) {
		this.remain = remain;
	}


	/**
	 * 根据request初始化
	 * @param request
	 * @throws Exception
	 */
	public void initBillByRequest(HttpServletRequest request) throws Exception {
		this.costIp=request.getRemoteAddr();
		this.costTime=new Date();
		this.channelId=request.getParameter("channelId");
		this.infoId=request.getParameter("infoId");
	}
	

	/**
	 * @return the costIp
	 */
	public String getCostIp() {
		return costIp;
	}
	/**
	 * @param costIp the costIp to set
	 */
	public void setCostIp(String costIp) {
		this.costIp = costIp;
	}
	/**
	 * @return the costUserName
	 */
	public String getCostUserName() {
		return costUserName;
	}
	/**
	 * @param costUserName the costUserName to set
	 */
	public void setCostUserName(String costUserName) {
		this.costUserName = costUserName;
	}
	/**
	 * @return the costNumber
	 */
	public int getCostNumber() {
		return costNumber;
	}
	/**
	 * @param costNumber the costNumber to set
	 */
	public void setCostNumber(int costNumber) {
		this.costNumber = costNumber;
	}
 
	/**
	 * @return the cType
	 */
	public String getCType() {
		return cType;
	}
	/**
	 * @param type the cType to set
	 */
	public void setCType(String type) {
		cType = type;
	}
	/**
	 * @return the costTime
	 */
	public Date getCostTime() {
		return costTime;
	}
	/**
	 * @param costTime the costTime to set
	 */
	public void setCostTime(Date costTime) {
		this.costTime = costTime;
	}
	/**
	 * @return the channelId
	 */
	public String getChannelId() {
		return channelId;
	}
	/**
	 * @param channelId the channelId to set
	 */
	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}
	/**
	 * @return the infoId
	 */
	public String getInfoId() {
		return infoId;
	}
	/**
	 * @param infoId the infoId to set
	 */
	public void setInfoId(String infoId) {
		this.infoId = infoId;
	}


	/**
	 * @return the operatorId
	 */
	public String getOperatorId() {
		return operatorId;
	}


	/**
	 * @param operatorId the operatorId to set
	 */
	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}


	/**
	 * @return the startDate
	 */
	public Date getStartDate() {
		return startDate;
	}


	/**
	 * @param startDate the startDate to set
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}


	/**
	 * @return the endDate
	 */
	public Date getEndDate() {
		return endDate;
	}


	/**
	 * @param endDate the endDate to set
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}


	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}


	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}


	/**
	 * @return the mark
	 */
	public String getMark() {
		return mark;
	}


	/**
	 * @param mark the mark to set
	 */
	public void setMark(String mark) {
		this.mark = mark;
	}
}
